import Request from '@/utils/request'
import { Control, ControlParams } from './types/control'

/**
 * 布控关注相关接口开始
 */
// 布控列表
export function getControlList (params: ControlParams) {
  return Request({
    url: '/xzzagk/bukong',
    method: 'GET',
    params
  })
}
// 新增布控关注
export function addControl (data: Control) {
  return Request({
    url: '/xzzagk/bukong',
    method: 'POST',
    data
  })
}
// 编辑布控信息
export function editControl (data: Control) {
  return Request({
    url: '/xzzagk/bukong',
    method: 'PUT',
    data
  })
}
// 删除布控信息
export function delControl (id: number) {
  return Request({
    url: `/xzzagk/bukong/${id}`,
    method: 'DELETE'
  })
}
// 布控信息详情
export function detailControl (id: number) {
  return Request({
    url: `/xzzagk/bukong/${id}`,
    method: 'GET'
  })
}
// 撤销布控
export function cancelControl (id:number, reason:string) {
  return Request({
    url: `/xzzagk/bukong/cancel?id=${id}&reason=${reason}`,
    method: 'POST'
  })
}
// 左上角统计
export function zksltj () {
  return Request({
    url: '/xzzagk/bukong/zksltj',
    method: 'GET'
  })
}
// 添加附件
export function addFile (params: any) {
  return Request({
    url: '/xzzagk/bukong/addFile',
    method: 'POST',
    params
  })
}
// 删除附件
export function deleteFile (id:number) {
  return Request({
    url: `/xzzagk/bukong/deleteFile/${id}`,
    method: 'DELETE'
  })
}
// 获得附件列表
export function fileList (bkid:number) {
  return Request({
    url: `/xzzagk/bukong/fileList/${bkid}`,
    method: 'GET'
  })
}
// 获得历史记录
export function bkLogs (bkid:number) {
  return Request({
    url: `/xzzagk/bukong/bkLogs/${bkid}`,
    method: 'GET'
  })
}
// 新增联动用户
export function addTellUsers (data:any) {
  return Request({
    url: '/xzzagk/bukong/addTellUsers',
    method: 'POST',
    data
  })
}
// 获得联动用户信息
export function tellUsers (bkid:number) {
  return Request({
    url: `/xzzagk/bukong/tellUsers/${bkid}`,
    method: 'GET'
  })
}
// 删除附件
export function deleteTellUsers (id:number) {
  return Request({
    url: `/xzzagk/bukong/deleteTellUsers/${id}`,
    method: 'DELETE'
  })
}
/**
 * 布控关注相关接口结束
 */
